Optimal. Leaf size=223 \[ -\frac {8 (216 A-83 B) \sin (c+d x)}{105 a^4 d}+\frac {(21 A-8 B) \sin (c+d x) \cos (c+d x)}{2 a^4 d}-\frac {4 (216 A-83 B) \sin (c+d x) \cos (c+d x)}{105 a^4 d (\sec (c+d x)+1)}-\frac {(129 A-52 B) \sin (c+d x) \cos (c+d x)}{105 a^4 d (\sec (c+d x)+1)^2}+\frac {x (21 A-8 B)}{2 a^4}-\frac {(2 A-B) \sin (c+d x) \cos (c+d x)}{5 a d (a \sec (c+d x)+a)^3}-\frac {(A-B) \sin (c+d x) \cos (c+d x)}{7 d (a \sec (c+d x)+a)^4} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.65, antiderivative size = 223, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {4020, 3787, 2635, 8, 2637} \[ -\frac {8 (216 A-83 B) \sin (c+d x)}{105 a^4 d}+\frac {(21 A-8 B) \sin (c+d x) \cos (c+d x)}{2 a^4 d}-\frac {4 (216 A-83 B) \sin (c+d x) \cos (c+d x)}{105 a^4 d (\sec (c+d x)+1)}-\frac {(129 A-52 B) \sin (c+d x) \cos (c+d x)}{105 a^4 d (\sec (c+d x)+1)^2}+\frac {x (21 A-8 B)}{2 a^4}-\frac {(2 A-B) \sin (c+d x) \cos (c+d x)}{5 a d (a \sec (c+d x)+a)^3}-\frac {(A-B) \sin (c+d x) \cos (c+d x)}{7 d (a \sec (c+d x)+a)^4} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2635
Rule 2637
Rule 3787
Rule 4020
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x) (A+B \sec (c+d x))}{(a+a \sec (c+d x))^4} \, dx &=-\frac {(A-B) \cos (c+d x) \sin (c+d x)}{7 d (a+a \sec (c+d x))^4}+\frac {\int \frac {\cos ^2(c+d x) (a (9 A-2 B)-5 a (A-B) \sec (c+d x))}{(a+a \sec (c+d x))^3} \, dx}{7 a^2}\\ &=-\frac {(A-B) \cos (c+d x) \sin (c+d x)}{7 d (a+a \sec (c+d x))^4}-\frac {(2 A-B) \cos (c+d x) \sin (c+d x)}{5 a d (a+a \sec (c+d x))^3}+\frac {\int \frac {\cos ^2(c+d x) \left (a^2 (73 A-24 B)-28 a^2 (2 A-B) \sec (c+d x)\right )}{(a+a \sec (c+d x))^2} \, dx}{35 a^4}\\ &=-\frac {(129 A-52 B) \cos (c+d x) \sin (c+d x)}{105 a^4 d (1+\sec (c+d x))^2}-\frac {(A-B) \cos (c+d x) \sin (c+d x)}{7 d (a+a \sec (c+d x))^4}-\frac {(2 A-B) \cos (c+d x) \sin (c+d x)}{5 a d (a+a \sec (c+d x))^3}+\frac {\int \frac {\cos ^2(c+d x) \left (a^3 (477 A-176 B)-3 a^3 (129 A-52 B) \sec (c+d x)\right )}{a+a \sec (c+d x)} \, dx}{105 a^6}\\ &=-\frac {(129 A-52 B) \cos (c+d x) \sin (c+d x)}{105 a^4 d (1+\sec (c+d x))^2}-\frac {(A-B) \cos (c+d x) \sin (c+d x)}{7 d (a+a \sec (c+d x))^4}-\frac {(2 A-B) \cos (c+d x) \sin (c+d x)}{5 a d (a+a \sec (c+d x))^3}-\frac {4 (216 A-83 B) \cos (c+d x) \sin (c+d x)}{105 d \left (a^4+a^4 \sec (c+d x)\right )}+\frac {\int \cos ^2(c+d x) \left (105 a^4 (21 A-8 B)-8 a^4 (216 A-83 B) \sec (c+d x)\right ) \, dx}{105 a^8}\\ &=-\frac {(129 A-52 B) \cos (c+d x) \sin (c+d x)}{105 a^4 d (1+\sec (c+d x))^2}-\frac {(A-B) \cos (c+d x) \sin (c+d x)}{7 d (a+a \sec (c+d x))^4}-\frac {(2 A-B) \cos (c+d x) \sin (c+d x)}{5 a d (a+a \sec (c+d x))^3}-\frac {4 (216 A-83 B) \cos (c+d x) \sin (c+d x)}{105 d \left (a^4+a^4 \sec (c+d x)\right )}-\frac {(8 (216 A-83 B)) \int \cos (c+d x) \, dx}{105 a^4}+\frac {(21 A-8 B) \int \cos ^2(c+d x) \, dx}{a^4}\\ &=-\frac {8 (216 A-83 B) \sin (c+d x)}{105 a^4 d}+\frac {(21 A-8 B) \cos (c+d x) \sin (c+d x)}{2 a^4 d}-\frac {(129 A-52 B) \cos (c+d x) \sin (c+d x)}{105 a^4 d (1+\sec (c+d x))^2}-\frac {(A-B) \cos (c+d x) \sin (c+d x)}{7 d (a+a \sec (c+d x))^4}-\frac {(2 A-B) \cos (c+d x) \sin (c+d x)}{5 a d (a+a \sec (c+d x))^3}-\frac {4 (216 A-83 B) \cos (c+d x) \sin (c+d x)}{105 d \left (a^4+a^4 \sec (c+d x)\right )}+\frac {(21 A-8 B) \int 1 \, dx}{2 a^4}\\ &=\frac {(21 A-8 B) x}{2 a^4}-\frac {8 (216 A-83 B) \sin (c+d x)}{105 a^4 d}+\frac {(21 A-8 B) \cos (c+d x) \sin (c+d x)}{2 a^4 d}-\frac {(129 A-52 B) \cos (c+d x) \sin (c+d x)}{105 a^4 d (1+\sec (c+d x))^2}-\frac {(A-B) \cos (c+d x) \sin (c+d x)}{7 d (a+a \sec (c+d x))^4}-\frac {(2 A-B) \cos (c+d x) \sin (c+d x)}{5 a d (a+a \sec (c+d x))^3}-\frac {4 (216 A-83 B) \cos (c+d x) \sin (c+d x)}{105 d \left (a^4+a^4 \sec (c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 1.20, size = 555, normalized size = 2.49 \[ \frac {\sec \left (\frac {c}{2}\right ) \cos \left (\frac {1}{2} (c+d x)\right ) \left (14700 d x (21 A-8 B) \cos \left (c+\frac {d x}{2}\right )+14700 d x (21 A-8 B) \cos \left (\frac {d x}{2}\right )+386190 A \sin \left (c+\frac {d x}{2}\right )-422478 A \sin \left (c+\frac {3 d x}{2}\right )+132930 A \sin \left (2 c+\frac {3 d x}{2}\right )-181461 A \sin \left (2 c+\frac {5 d x}{2}\right )+3675 A \sin \left (3 c+\frac {5 d x}{2}\right )-36003 A \sin \left (3 c+\frac {7 d x}{2}\right )-9555 A \sin \left (4 c+\frac {7 d x}{2}\right )-945 A \sin \left (4 c+\frac {9 d x}{2}\right )-945 A \sin \left (5 c+\frac {9 d x}{2}\right )+105 A \sin \left (5 c+\frac {11 d x}{2}\right )+105 A \sin \left (6 c+\frac {11 d x}{2}\right )+185220 A d x \cos \left (c+\frac {3 d x}{2}\right )+185220 A d x \cos \left (2 c+\frac {3 d x}{2}\right )+61740 A d x \cos \left (2 c+\frac {5 d x}{2}\right )+61740 A d x \cos \left (3 c+\frac {5 d x}{2}\right )+8820 A d x \cos \left (3 c+\frac {7 d x}{2}\right )+8820 A d x \cos \left (4 c+\frac {7 d x}{2}\right )-539490 A \sin \left (\frac {d x}{2}\right )-184520 B \sin \left (c+\frac {d x}{2}\right )+184464 B \sin \left (c+\frac {3 d x}{2}\right )-72240 B \sin \left (2 c+\frac {3 d x}{2}\right )+77168 B \sin \left (2 c+\frac {5 d x}{2}\right )-8400 B \sin \left (3 c+\frac {5 d x}{2}\right )+15164 B \sin \left (3 c+\frac {7 d x}{2}\right )+2940 B \sin \left (4 c+\frac {7 d x}{2}\right )+420 B \sin \left (4 c+\frac {9 d x}{2}\right )+420 B \sin \left (5 c+\frac {9 d x}{2}\right )-70560 B d x \cos \left (c+\frac {3 d x}{2}\right )-70560 B d x \cos \left (2 c+\frac {3 d x}{2}\right )-23520 B d x \cos \left (2 c+\frac {5 d x}{2}\right )-23520 B d x \cos \left (3 c+\frac {5 d x}{2}\right )-3360 B d x \cos \left (3 c+\frac {7 d x}{2}\right )-3360 B d x \cos \left (4 c+\frac {7 d x}{2}\right )+243320 B \sin \left (\frac {d x}{2}\right )\right )}{6720 a^4 d (\cos (c+d x)+1)^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.45, size = 240, normalized size = 1.08 \[ \frac {105 \, {\left (21 \, A - 8 \, B\right )} d x \cos \left (d x + c\right )^{4} + 420 \, {\left (21 \, A - 8 \, B\right )} d x \cos \left (d x + c\right )^{3} + 630 \, {\left (21 \, A - 8 \, B\right )} d x \cos \left (d x + c\right )^{2} + 420 \, {\left (21 \, A - 8 \, B\right )} d x \cos \left (d x + c\right ) + 105 \, {\left (21 \, A - 8 \, B\right )} d x + {\left (105 \, A \cos \left (d x + c\right )^{5} - 210 \, {\left (2 \, A - B\right )} \cos \left (d x + c\right )^{4} - 4 \, {\left (1509 \, A - 592 \, B\right )} \cos \left (d x + c\right )^{3} - 4 \, {\left (3411 \, A - 1318 \, B\right )} \cos \left (d x + c\right )^{2} - {\left (11619 \, A - 4472 \, B\right )} \cos \left (d x + c\right ) - 3456 \, A + 1328 \, B\right )} \sin \left (d x + c\right )}{210 \, {\left (a^{4} d \cos \left (d x + c\right )^{4} + 4 \, a^{4} d \cos \left (d x + c\right )^{3} + 6 \, a^{4} d \cos \left (d x + c\right )^{2} + 4 \, a^{4} d \cos \left (d x + c\right ) + a^{4} d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.28, size = 233, normalized size = 1.04 \[ \frac {\frac {420 \, {\left (d x + c\right )} {\left (21 \, A - 8 \, B\right )}}{a^{4}} - \frac {840 \, {\left (9 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 7 \, A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2} a^{4}} + \frac {15 \, A a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 15 \, B a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 189 \, A a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 147 \, B a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 1365 \, A a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 805 \, B a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 11655 \, A a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 5145 \, B a^{24} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{28}}}{840 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.16, size = 332, normalized size = 1.49 \[ \frac {\left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{56 d \,a^{4}}-\frac {B \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{56 d \,a^{4}}-\frac {9 A \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{40 d \,a^{4}}+\frac {7 B \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{40 d \,a^{4}}+\frac {13 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) A}{8 d \,a^{4}}-\frac {23 B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d \,a^{4}}-\frac {111 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d \,a^{4}}+\frac {49 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d \,a^{4}}-\frac {9 A \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{4} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {2 B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{4} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {7 A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \,a^{4} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {2 B \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d \,a^{4} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {21 A \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{4}}-\frac {8 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B}{d \,a^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.71, size = 364, normalized size = 1.63 \[ -\frac {3 \, A {\left (\frac {280 \, {\left (\frac {7 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {9 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}\right )}}{a^{4} + \frac {2 \, a^{4} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {a^{4} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} + \frac {\frac {3885 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {455 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {63 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {5 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}}{a^{4}} - \frac {5880 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{4}}\right )} - B {\left (\frac {1680 \, \sin \left (d x + c\right )}{{\left (a^{4} + \frac {a^{4} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} + \frac {\frac {5145 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {805 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {147 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {15 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}}{a^{4}} - \frac {6720 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{4}}\right )}}{840 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.00, size = 179, normalized size = 0.80 \[ \frac {\frac {21\,A\,d\,x}{2}-4\,B\,d\,x}{a^4\,d}-\frac {\left (9\,A-2\,B\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (7\,A-2\,B\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^4\,d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^2}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {111\,A}{8}-\frac {49\,B}{8}\right )}{a^4\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {13\,A}{8}-\frac {23\,B}{24}\right )}{a^4\,d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {9\,A}{40}-\frac {7\,B}{40}\right )}{a^4\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (\frac {A}{56}-\frac {B}{56}\right )}{a^4\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {A \cos ^{2}{\left (c + d x \right )}}{\sec ^{4}{\left (c + d x \right )} + 4 \sec ^{3}{\left (c + d x \right )} + 6 \sec ^{2}{\left (c + d x \right )} + 4 \sec {\left (c + d x \right )} + 1}\, dx + \int \frac {B \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{\sec ^{4}{\left (c + d x \right )} + 4 \sec ^{3}{\left (c + d x \right )} + 6 \sec ^{2}{\left (c + d x \right )} + 4 \sec {\left (c + d x \right )} + 1}\, dx}{a^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________